function passwordquery() {
    var webSiteName = $("#webSiteName").val();

    $("#passwordcreatebtn").text("提交中...");
    $.ajax({
        url: '/pmc/pwdquery',
        type: 'post',
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify({
            webSiteName: webSiteName,
            // jwt: "fyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJleHAiOjE1MzI5NjI2ODE1MDYsInBheWxvYWQiOiJcIjE4OTMwMTE0MDIxXCIifQ.pQRpVebRRHeAAzbXi08_h31Uri_fUZIibsSAyUavxGg"
            jwt: localStorage.getItem("jwt")
        }),

        async: true, //默认为true 异步
        dataType: 'json',
        success: function (data) {
            // $("#passwordquerybtn").text("提   交");
            if (data.errCode == '0000000') {
                if (data.data != null) {
                    tip('密码实体查询成功！', 2000, 'success');  //设置显示时间
                    $("#phone").val(data.data.userName);
                    $("#password").val(data.data.password);
                    $("#peIdIpt").val(data.data.peId);
                } else {
                    tip('查无此值', 2000, 'warning');  //设置显示时间
                }
            } else {
                tip(data.errorMessage, 2000, 'warning');  //设置显示时间
                if (data.errCode == '1000004') {//如果是jwt失效了，则跳到登录页
                    setTimeout("this.location.href= 'login.html'", 1);
                }
            }

        }
    });
}


function passwordsave() {
    var peId = $("#peIdIpt").val();
    var phone = $("#phone").val();
    var password = $("#password").val();
    $("#passwordsavebtn").text("提交中...");
    $.ajax({
        url: '/pmc/pwdUpdate',
        type: 'post',
        contentType: "application/json; charset=utf-8",
        data: JSON.stringify({
            peId: peId,
            userName: phone,
            password: password,
            jwt: localStorage.getItem("jwt")
        }),

        async: true, //默认为true 异步
        dataType: 'json',
        success: function (data) {
            // $("#passwordquerybtn").text("提   交");
            if (data.errCode == '0000000') {
                tip('密码实体修改成功！', 2000, 'success');  //设置显示时间
                setTimeout("this.location.href= 'passwordquery.html'", 1000);
            } else {
                tip(data.errorMessage, 2000, 'warning');  //设置显示时间
                if (data.errCode == '1000004') {//如果是jwt失效了，则跳到登录页
                    setTimeout("this.location.href= 'login.html'", 1);
                }
            }
        }
    });
}

function password2create() {

    setTimeout("this.location.href= 'passwordcreate.html'", 1);

}